package com.retail.bbq.cola.enums;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

public enum PlatformEnum {
    MT(1, "MT","mtOrderDetailDeal"),
    LS(2, "LS","lsOrderDetailDeal"),
    ;
    private int platform;
    private String platformName;
    private String dealValue;

    PlatformEnum(int platform, String platformName, String dealValue) {
        this.platform = platform;
        this.platformName = platformName;
        this.dealValue = dealValue;
    }

    public int getPlatform() {
        return this.platform;
    }

    public String getPlatformName() {
        return this.platformName;
    }


    public String getDealValue() {
        return this.dealValue;
    }

    private static final Map<Integer, PlatformEnum> platformMap = new HashMap<>();

    static {
        Arrays.stream(PlatformEnum.values())
                .forEach(val -> {
                    platformMap.put(val.getPlatform(), val);
                });
    }

    public static PlatformEnum getEnumByType(Integer type) {
        return platformMap.get(type);
    }
}
